package ch.swissfurs.efnavigator;

import org.apache.http.client.methods.HttpGet;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.text.Html;
import android.view.View;
import android.view.View.OnClickListener;
import android.graphics.Typeface;
import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;

public class EFNavigatorActivity extends BaseActivity
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        
        setContentView(R.layout.main);
        
        Button generalInfoButton = (Button)findViewById(R.id.allgemeineInfosButton);
        generalInfoButton.setOnClickListener(launchGeneralInfoView);

        Button artShowButton = (Button)findViewById(R.id.artShowButton);
        artShowButton.setOnClickListener(launchArtShowView);
        
        Button dealersButton = (Button)findViewById(R.id.dealersDenButton);
        dealersButton.setOnClickListener(launchDealersDenView);
        
        Button conEventsButton = (Button)findViewById(R.id.conEventsButton);
        conEventsButton.setOnClickListener(launchConEventsView);
        
        Button conBookButton = (Button)findViewById(R.id.conBookButton);
        conBookButton.setOnClickListener(launchConBookView);
        
    }
    
    private OnClickListener launchGeneralInfoView = new OnClickListener() {
		public void onClick(View v) {
			Intent generalInfoStartIntent = new Intent(EFNavigatorActivity.this, GeneralInfoActivity.class);
			Html htmlContent =(Html)getInputStreamFromUrl("http://www.eurofurence.org/EF18/policies_artshowartistrules.html");
			generalInfoStartIntent.putExtra("handMeStuff", htmlContent);
			EFNavigatorActivity.this.startActivity(generalInfoStartIntent);
		}
	};
	
	private OnClickListener launchArtShowView = new OnClickListener() {
		public void onClick(View v) {
			Intent dealersDenStartIntent = new Intent(EFNavigatorActivity.this, ArtShowActivity.class);
			dealersDenStartIntent.putExtra("handMeStuff", R.string.dealersDen);
			EFNavigatorActivity.this.startActivity(dealersDenStartIntent);
		}
	};
	
	private OnClickListener launchDealersDenView = new OnClickListener() {
		public void onClick(View v) {
			Intent dealersDenStartIntent = new Intent(EFNavigatorActivity.this, DealersDenActivity.class);
			dealersDenStartIntent.putExtra("handMeStuff", R.string.dealersDen);
			EFNavigatorActivity.this.startActivity(dealersDenStartIntent);
		}
	};
	
	private OnClickListener launchConEventsView = new OnClickListener() {
		public void onClick(View v) {
			Intent dealersDenStartIntent = new Intent(EFNavigatorActivity.this, ConEventsActivity.class);
			dealersDenStartIntent.putExtra("handMeStuff", R.string.dealersDen);
			EFNavigatorActivity.this.startActivity(dealersDenStartIntent);
		}
	};
	
	private OnClickListener launchConBookView = new OnClickListener() {
		public void onClick(View v) {
			Intent dealersDenStartIntent = new Intent(EFNavigatorActivity.this, ConBookDenActivity.class);
			dealersDenStartIntent.putExtra("handMeStuff", R.string.dealersDen);
			EFNavigatorActivity.this.startActivity(dealersDenStartIntent);
		}
	};
}
